#ifndef BASERTSPCLIENT_INCLUDED
#define BASERTSPCLIENT_INCLUDED

#include "base.h"
#include "BaseTcp.h"
#include "RTSPClientSession.h"

template <typename TYPE>
class AAA
{
public:
	AAA(){};
	void Test(TYPE val);
};
template <class TYPE>
void AAA<TYPE>::Test(TYPE val)
{
	cout << val << endl;
}
class BASE_API BaseRtspClient:public BaseConnector,public RTSPClientSession
{
public:
	BaseRtspClient(Proactor* proactor,char* remoteip=NULL,unsigned short remoteport=RTSPSession::RTSP_PORT);
	BaseRtspClient(Proactor* proactor,const string &url);
	~BaseRtspClient(void);
protected:
	virtual pj_bool_t OnDataRead(void *data,pj_size_t size,int status,pj_size_t* remainder);
	virtual pj_bool_t OnDataSend(pj_ioqueue_op_key_t *send_key,int sendsize);
	virtual pj_bool_t OnConnect(int status);
protected:
	////subclass implement below virtual method
	//virtual void OnOptionsReply(int status,RTSPResponse& reply){};
	//virtual void OnDescribeReply(int status,RTSPResponse& reply){};
	//virtual void OnSetupReply(int status,RTSPResponse& reply){};
	//virtual void OnPlayReply(int status,RTSPResponse& reply){};
public:
	void setURL(const string &url);
	int  sendOptionsRequest();
	int  sendDescribeRequest();
	int  sendSetupRequest(int port);
	int  sendPlayRequest(float fStart=0.00f);
	int  sendTeardownRequest();
};

#endif
